#ifndef __GROUPED_POLYGON_H__
#define __GROUPED_POLYGON_H__

#pragma once

//#include "Polygon.h"
#include "MultiPolygon.h"


class CGroupIdx
{
	std::vector<int>		m_arGroupedIdx;

public:
	CGroupIdx() {}
	~CGroupIdx() {}

	int		Size()			{ return (int)m_arGroupedIdx.size(); }
	int		GetAt(int idx)	{ return m_arGroupedIdx[idx]; }
	void	Add(int idx)	{ m_arGroupedIdx.push_back(idx); }
};


class CGroupedPolygon
{
private:
	CMultiPolygon			*m_pMultiPolygon;	// the pointer to all polygons array
	std::vector<CGroupIdx>		m_arGroupedPolys;	// all the grouped polygons


public:
	CGroupedPolygon(void);
	~CGroupedPolygon(void);

	void	Clear();
	void	SetMultiPolygon( CMultiPolygon *pMP );
	
	int			Size();
	CGroupIdx	&GetAt( int idx );

	// drawings
	void		Draw( int nIdx, CDC *pDC, BOOL bShowVertices, BOOL bShowVertexIndices );

	void		Add( CGroupIdx group );
	void		RemoveAt( int idx );
};

#endif	// __GROUPED_POLYGON_H__
